﻿@model MobileSales.Model.Products.Category

@{
    View.Title = Strings.Categories + " - " +  Strings.Edit;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@Strings.Categories &nbsp;&raquo;&nbsp; @Strings.Edit</h2>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>

        @Html.HiddenFor(model => model.Id)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
         <div class="editor-label">
            @Html.LabelFor(model => model.ParentId)
        </div>      
        <div class="editor-field">
            @Html.CategorySelect("ParentId",
                                 false,
                                 Model.ParentId.HasValue ? new int[] { Model.ParentId.Value } : null,
                                    Strings.TopLevelCategory)
        </div>
        
        <p>
            <input type="submit" value="@Strings.Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

